<?php
include '_lib.php';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?$_SESSION["lang"]?$_SESSION["lang"]:'de'?>" >
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="" />
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta name="robots" content="all" />
	<meta name="language" content="<?$_SESSION["lang"]?$_SESSION["lang"]:'de'?>" />
	<link rel="shortcut icon" href="img/favicon.png">	
	<title><?=t("Minecraft Piraten")?></title>

	<!-- TinyMCE -->
	<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
	<script type="text/javascript">
	tinyMCE2 = tinyMCE;
		tinyMCE.init({
	        mode : "exact",
	        elements : "mce",
			theme : "simple"
		});
		tinyMCE2.init({
	        mode : "exact",
	        elements : "mce2",
			theme : "simple"
		});		
	</script>
	<!-- /TinyMCE -->
	
	<!-- Galerie -->
	<script type="text/javascript" src="jscripts/prototype.js"></script>
	<script type="text/javascript" src="jscripts/scriptaculous.js?load=effects,builder"></script>
	<script type="text/javascript" src="jscripts/lightbox.js"></script>	
	<!-- /Galerie -->
		
	
	<script type="text/javascript">
	function ShowById(id) {
		  if (typeof(sbid) != "undefined"){
			  sbid.style.display = "none"; 
		  }

		  if (typeof(sbidb) != "undefined"){
			  sbidb.className = 'norm'; 
		  }		 
		  
		  sbidb = document.getElementById(id+'_button');
		  if (sbidb != null){
			  sbidb.className = 'select';
		  }
		  
		  sbid = document.getElementById(id);
		  sbid.style.display = "block"
		}
	</script>
	
	<style type="text/css" title="currentStyle" media="all">
		<?php 
		if ($handle = scandir('css/')) {
		    while( list ( $key, $val ) = each ( $handle ) ){
		        if (($val[0] != ".") AND (substr($val,-4)=='.css')) {
		        	echo '@import "css/'.$val.'";';
		        }
		    }
		}?>
		
	</style>
</head>

<body>

<div id="wrapper">
	<div id="header">
		<h1><?=t("Minecraft Piraten")?></h1>
		<h3><?=t("Minecaft Server der Piraten")?></h3>
	</div>
	<div id="topnavi">
		<div style="z-index: 1; position:absolute; padding-left:650px; top: 40px;">
			<?php  
			 if ($handle = scandir('local/')) {
			    while( list ( $key, $val ) = each ( $handle ) ){
			        if ($val[0] != ".") {
			        	echo "<a href='/".substr($val,0,-4)."/' ><img src='/img/flags/".substr($val,0,-4).".png' /></a> ";
			        }
			    }
			} 
			?>
		</div>
		<ul>
			<li class="<?=(($_GET["load"]=='text')AND($_GET["text"]=='home'))?'select':'norm'?>"><a href="<?=$_t?>/"><?=t("HOME")?></a></li>
			<li class="<?=$_GET["load"]=='server'?'select':'norm'?>"><a href="server.html"><?=t("Liste")?></a></li>
			<li class="<?=(($_GET["load"]=='text')AND($_GET["text"]=='impressum'))?'select':'norm'?>"><a href="text-impressum.html"><?=t("Impressum")?></a></li>
			<li class="<?=(($_GET["load"]=='text')AND($_GET["text"]=='config'))?'select':'norm'?>"><a href="text-config.html"><?=t("Minecraft Einrichten")?></a></li>
			<li class="<?=(($_GET["load"]=='text')AND($_GET["text"]=='hilfe'))?'select':'norm'?>"><a href="text-hilfe.html"><?=t("Hilfe")?></a></li>
			<li class="<?=(($_GET["load"]=='user' OR $_GET["load"]=='edit_server') AND ($_username))?'select':'norm'?>"><a href="user.html"><?=t("Meine Server")?></a></li>
			<li class="<?=(($_GET["load"]=='user' OR $_GET["load"]=='edit_server') AND (!$_username))?'select':'norm'?>"><a href="<?=$_username?'logout':'login'?>.html"><?=t($_username?'Logout':'Login')?></a></li>
		</ul>
	</div>
	<div id="headimg">&nbsp;</div>
	<div id="bodybox">
		

<?php 
if ($_GET["load"]){
	if (file_exists("view/".$_GET["load"].".php")){
		include_once "view/".$_GET["load"].".php";
	}else{
		$_GET["text"] = "404";
		include_once "view/text.php";
	}
}else{
	$_GET["text"] = "home";
	include_once "view/text.php";
}?>


	</div>
	</div>
	<div id="footer">
		<?=t("&copy; Webseite von <a href='http://gplus.to/xedp3X'>XEdP3X</a> unter <a href='http://www.gnu.de/documents/gpl.en.html'>GPL</a>. Inhalte stehen unter der <a href='http://creativecommons.org/licenses/by-sa/3.0/' />CC-BY-SA</a>.")?> 
	<div class="cleaner"></div>
</div>

</body>
</html>